package pantomime.gestures;
import pantomime.hardware.*;

public class StaticGesture extends Gesture {

	public IMU oIMU;
	public FlexSensors oFlexSensor;
	
	@Override
	public int Recognize(Glove oGlove) {
		boolean bGestureEqualsGlove = false;
		
		bGestureEqualsGlove = this.compareToGlove(oGlove);
		
		if (bGestureEqualsGlove){
			return this._sID;
		}
		else{
			return -1;
		}			
	}
	
	public StaticGesture(){
		super();
		oFlexSensor = new FlexSensors();
		oIMU = new IMU();
	}
	
	public StaticGesture(String sName, int sID){
		super(sName, sID);
		oFlexSensor = new FlexSensors();
		oIMU = new IMU();
	}

	@Override
	public String toString() {
		return "StaticGesture [ID=" + _sID + ", Name=" + _sName + ", " + oIMU.toString() + ", " + oFlexSensor.toString()
				+ "]";
	}

	@Override
	public double compareToGlove(Glove oGlove) {
		
		if(this.oIMU.equals(oGlove.oIMU)){
			return 0.0;
		}
		
		double percent = this.oFlexSensor.getPercentMatch(oGlove.oFlexSensor);
		
		return percent;
	}
	
}
